# 单词逆序
def reverseWords(s: str):
    tokens = s.split(" ")
    tokens.reverse()
    return " ".join(tokens)

# print(reverseWords("i am a student"))

def rotateString(s, goal):
    if len(s) != len(goal):
        return False
    return goal in (s + s)
# print(rotateString("abcde","cdeab"))
# print(rotateString("abcde","cedab"))
def countPrefixes(words: list,s: str):
    count = 0
    for word in words:
        if(s.startswith(word)):
            count+=1
    return count
print(countPrefixes(['a','b','ab','bc'],"abc"))